import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Patent from '../views/Patent.vue'
import Home from '../views/Home.vue'
import Conference from '../views/Conference.vue'
import PaperList from '../views/Paper_list.vue'
import SubPaper from '../views/Paper_sub.vue'
import PaperSearch from '../views/Paper_search.vue'
import Policy from '../views/Policy.vue'
import Journal from '../views/Journal.vue'
import Project from '../views/Project.vue'
import Recommendation from '../views/Journal_recommendation.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },{
    path: '/patent',
    name: 'Patent',
    component: Patent
  },{
    path: '/conference',
    name: 'Conference',
    component: Conference
  },{
    path: '/paper-list',
    name: 'PaperList',
    component: PaperList,
  },{
    path:'/paper/:name',
    name:'SubPaper',
    component:SubPaper
  },{
    path:'/paper-search',
    name:'PaperSearch',
    component:PaperSearch
  },{
    path: '/policy',
    name: 'Policy',
    component: Policy
  },{
    path: '/journal',
    name: 'Journal',
    component: Journal
  },{
    path: '/project',
    name: 'Project',
    component: Project
  },{
    path: '/recommendation',
    name: 'Recommendation',
    component: Recommendation
  },{
    path: '/login',
    name: 'Login',
    component: Login
  }
]

const router = new VueRouter({
  routes,
  scrollBehavior (to, from, savedPosition) {
    // return 期望滚动到哪个的位置
    return { x: 0, y: 0 }
  }
})

export default router
